package pack0806;

public class DemoC {
    public static void main(String[] args){
        //随机数 Math.random()--->[0,1)
        int a = (int)(Math.random()*10+1);//产生一个1到10的随机整数
        int b = (int)(Math.random()*10+1);
        System.out.println(a);
        System.out.println(b);
        boolean b1 = (a==b);
        boolean b2 = (a!=b);
        boolean b3 = (a>b);
        boolean b4 = (a<=b);
        System.out.println(b1);
        System.out.println(b2);
        System.out.println(b3);
        System.out.println(b4);
        System.out.println("------------------------");
        //与或非逻辑运算符 && || ！
        System.out.println(b3&&b4);
        System.out.println(b3||b4);
        System.out.println(!b3);
        System.out.println("------------------------");
        //三元运算符
        System.out.println(a);
        System.out.println(b);
        int c = a>b?a:b;
        System.out.println(c);
    }

}
